<?php
declare (strict_types = 1);

namespace app\controller\admin;

use app\eslib\EsUtils;
use app\model\admin\LoginState;
use app\model\AuthRulesModel;

class Index
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        //
    }

    public function main()
    {
        $data = [
            'stat_data' => [
                'zongzc' => '354',
                'benyuezc' => '211',
                'zuorizc' => '4',
                'jinrizc' => '2',
                'leijiczje' => '1290',
                'leijiczrs' => '16',
                'leijiczarpu' => '81',
                'benyueczje' => '1090',
                'benyueczrs' => '12',
                'benyueczarpu' => '91',
                'zuoriczje' => '100',
                'zuoriczrs' => '1',
                'zuoriczarpu' => '100',
                'jinriczje' => '20',
                'jinriczrs' => '1',
                'jinriczarpu' => '20',
                'zuorikh' => '28',
                'zuorixh' => '498',
                'jinrikh' => '2',
                'jinrixh' => '13',
            ]
        ];

        $data['yuefenzctj_data'] = [
            '1' => '2', '2' => '2', '3' => '16', '4' => '9', '5' => '2', '6' => '2', '7' => '0', '8' => '44', '9' => '20', '10' => '37',
            '11' => '10', '12' => '7', '13' => '19', '14' => '0', '15' => '5', '16' => '0', '17' => '2', '18' => '2', '19' => '20', '20' => '6',
            '21' => '4', '22' => '2', '23' => '0', '24' => '0', '25' => '0', '26' => '0', '27' => '0', '28' => '0', '29' => '0', '30' => '0',
            '31' => '0',
        ];
        $data['yuefencztj_data'] = [
            '1' => '0', '2' => '20', '3' => '0', '4' => '0', '5' => '0', '6' => '0', '7' => '0', '8' => '390', '9' => '0', '10' => '200',
            '11' => '20', '12' => '20', '13' => '0', '14' => '20', '15' => '0', '16' => '0', '17' => '0', '18' => '0', '19' => '0', '20' => '300',
            '21' => '100', '22' => '20', '23' => '0', '24' => '0', '25' => '0', '26' => '0', '27' => '0', '28' => '0', '29' => '0', '30' => '0',
            '31' => '0',
        ];
        return json(EsUtils::stdMessage(true, LoginState::getId(), $data));
    }

    /**
     * 返回权限数据
     */
    public function menu()
    {
        return json(AuthRulesModel::getMenus(LoginState::getId()));
    }
}
